import { defineStore } from "pinia";

export const useCounter = defineStore("count", {
  state: () => {
    return {
      num: 100,
    };
  },
  getters: {
    doubleNum(state) {
      return state.num * 2;
    },
  },
  actions: {
    increment() {
      this.num++;
    },
    decrement() {
      this.num--;
    },
  },
  persist: {
    key: "pinia-count-2206",
  },
});
